LocusIdCompat

An identifier for an unique state (locus) in the application. Should be stable across reboots and backup / restore.

Locus is a new concept introduced on Android Q and it lets the intelligence service provided by the Android system correlate state between different subsystems such as content capture, shortcuts, and notifications.

For example, if your app provides an activity representing a chat between 2 users (say A and B, this chat state could be represented by:


LocusIdCompat chatId = new LocusIdCompat("Chat_A_B");

And then you should use that chatId by:

NOTE: The LocusId is only used by a on-device intelligence service provided by the Android System, see android.view.contentcapture.ContentCaptureManager for more details.

Constructors

Link copied to clipboard
constructor(@NonNull id: @NonNull String)
Construct a new LocusIdCompat with the specified id.

Functions

Link copied to clipboard
open fun equals(@Nullable obj: @Nullable Any): Boolean
Link copied to clipboard
@NonNull
open fun getId(): @NonNull String
Gets the canonical id associated with the locus.
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
@RequiresApi(value = 29)
@NonNull
open fun toLocusId(): @NonNull LocusId
Link copied to clipboard
@RequiresApi(value = 29)
@NonNull
open fun toLocusIdCompat(@NonNull locusId: @NonNull LocusId): @NonNull LocusIdCompat
Returns an instance of LocusIdCompat from given LocusId.
Link copied to clipboard
@NonNull
open fun toString(): @NonNull String